#pragma once
#include <memory>
#include <string>
#include <mutex>
#include <filesystem>
#include <fstream>

#define AIR_FLASH_PATH "/mnt/media"
#define AIR_UDISK_PATH "/mnt/sd"
#define ROOMS_SD_PATH "/mnt/sd"





class DiskController{
public:
    using  Ptr = std::shared_ptr<DiskController>;    
    static Ptr instance();
    bool getDiskSpaceInfo(const std::string& path_str, unsigned long long& used_space, unsigned long long& total_space);
    bool setRealTimeRootPath();
    bool getRealTimeRootPath(std::string &path);
    bool getRealTimeBusinessPath(std::string subPath,std::string &path);
    bool clearStreamerFiles(std::string subPath);
    bool uDiskLoad();
    bool isMountPath(std::string path);
    uintmax_t calculateFolderSize(const std::string folderPath);
    bool createFileIfNotExists(const std::string& filename);
    DiskController(){}
    ~DiskController(){}

private:
    bool removeFilesInDirectory(const char* directoryPath);
    
private:
    std::string m_savePath;
    std::mutex m_diskMountLock;
};
